﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;
using System.Web.UI;
using System.Web.UI.WebControls;
using HungryCrowdLibrary;


namespace HungryCrowd.traders
{
    public partial class list : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            PopulateRepeater();
        }

        private void PopulateRepeater()
        {
            var categoryId = string.IsNullOrWhiteSpace(Request.QueryString["Id"]) ? 0 : int.Parse(Request.QueryString["Id"]);
            rptTraders.DataSource = API.TraderManager.GetList(x => x.CategoryId == categoryId && x.IsActive == true);
            rptTraders.DataBind();
        }

    }
}